<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$ci= &get_instance();
	$id = $ci->input->post('id',TRUE);
	$USER = getAccountUserObject();
	$ESCORT = $ci->escort_entity->init('user_id',$USER->getId());
	$MEDIA = $ci->media_entity->init('id', $id);
?> 
<form action="<?php echo site_url('escorts/submit_data/submit_edit_media');?>" name="submit_edit_media" id="submit_edit_media" method="post" enctype="multipart/form-data" >		
<div id="wrap-delete-item">	
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span>
				<?php if($MEDIA->getType() =='image'):?>
					<?php echo language_translate('media_manage_async_type_image');?>
				<?php else:?>
					<?php echo language_translate('media_manage_async_type_video');?>
				<?php endif; ?>
			</span>
		</div>		
		<div class="dashboard-info-right">
			<?php if($MEDIA->getType() =='image'):?>
				<?php echo thumb($MEDIA->getTargetFileImageTopPublic('big'),THUMB_WW,THUMB_HH);?>
			<?php else:?>
				<?php echo playvideo($MEDIA->getTargetFile('video'),$MEDIA->getTargetFile('avatar'),THUMB_VWW,THUMB_VHH);?>
			<?php endif; ?>
		</div>
		<div class="clear"></div>	
	</div>

	<?php if($MEDIA->getType() =='video'):?>
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span>
				<?php echo language_translate('media_manage_async_change_video_avatar');?>
			</span>
		</div>		
		<div class="dashboard-info-right">
			<?php echo form_upload('upload_avatar',"", 'id="upload_avatar" size="10"');?>
		</div>
		<div class="clear"></div>	
	</div>
	<?php endif; ?>

	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span>
				<?php echo language_translate('media_manage_async_alt_text');?>
			</span>
		</div>		
		<div class="dashboard-info-right">
			<input type="text" value="<?php echo $MEDIA->getAltText();?>" id="alt_text" name="alt_text" style="width:350px;"/>
		</div>
		<div class="clear"></div>	
	</div>

	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span>
				<?php echo language_translate('media_manage_async_desc_text');?>
			</span>
		</div>		
		<div class="dashboard-info-right">
			<textarea id="desc_text" name="desc_text" style="width:350px;height:130px"><?php echo $MEDIA->getDescText();?></textarea>
		</div>
		<div class="clear"></div>	
	</div>

	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span>
				<?php echo language_translate('media_manage_async_click_no');?>
			</span>
		</div>		
		<div class="dashboard-info-right">
			<?php echo $MEDIA->getClickedNo();?>
		</div>
		<div class="clear"></div>	
	</div>

	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span>
				&nbsp;
			</span>
		</div>		
		<div class="dashboard-info-right">
			<a href="javascript:void(0);" onclick="javascript:return deleteItem(<?php echo $MEDIA->getId();?>);"><?php echo language_translate('media_manage_async_delete_item');?></a>
			<?php echo loader_image("class='loading_update_image_delete hidden'");?>
		</div>
		<div class="clear"></div>	
	</div>

	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			&nbsp;
		</div>
		<div class="dashboard-info-right"> 
			<div class="select-box">
				<input type="submit" class="save-button" value="<?php echo language_translate('media_manage_async_update_button');?>" /> 
				<?php echo loader_image("class='loading_update_image hidden'");?>
			</div>
		 </div>
		<div class="clear"></div>
	</div>	 
</div>

<div class="dashboard-info-wrapper">
	<div id="update-message" class="message-status"><?php echo language_translate('update_successfully_message');?></div>
	<div class="clear"></div>
</div>

<input type="hidden" value="<?php echo $MEDIA->getId();?>" id="id" name="id" />
</form>

<?php exit; ?>